/*
 * 该controller放置所有不需要走登录校验的接口
 *
 */
let menu = require("../../assets/js/index/menu")
module.exports = {

  /**
   * 跳转到首页
   * @param req
   * @param res
   */
  index(req,res){
    if(!req.session.user){
      return res.redirect("/login");
    }
    let menuList = menu.menuList();
    let url = menuList.length > 0?menuList[0]["locationUrl"]:"";
    let title = menuList.length > 0?menuList[0]["title"]:"";
    res.view(url, {
      title: title,
      agentId:req.session.user.agentId,
      phone:req.session.user.phone,
    })
  },
}
